package com.pri.chat.nim.session.viewholder;//package com.pri.chardemo.session.viewholder;
//
//import android.app.Activity;
//import android.view.View;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.pri.chardemo.R;
//import com.pri.chardemo.redpacket.NIMOpenRpCallback;
//import com.pri.chardemo.redpacket.NIMRedPacketClient;
//import com.pri.chardemo.session.extension.RedPacketAttachment;
//import com.netease.nim.uikit.business.chatroom.adapter.ChatRoomMsgAdapter;
//import com.netease.nim.uikit.business.session.module.ModuleProxy;
//import com.netease.nim.uikit.business.session.module.list.MsgAdapter;
//import com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase;
//import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
//
//public class MsgViewHolderRedPacket extends MsgViewHolderBase {
//
//    private RelativeLayout sendView, revView;
//    private TextView sendContentText, revContentText;    // 红包描述
//    private TextView sendTitleText, revTitleText;    // 红包名称
//
//    public MsgViewHolderRedPacket(BaseMultiItemFetchLoadAdapter adapter) {
//        super(adapter);
//    }
//
//    @Override
//    public int getContentResId() {
//        return R.layout.red_packet_item;
//    }
//
//    @Override
//    public void inflateContentView() {
//        sendContentText = findViewById(R.id.tv_bri_mess_send);
//        sendTitleText = findViewById(R.id.tv_bri_name_send);
//        sendView = findViewById(R.id.bri_send);
//        revContentText = findViewById(R.id.tv_bri_mess_rev);
//        revTitleText = findViewById(R.id.tv_bri_name_rev);
//        revView = findViewById(R.id.bri_rev);
//    }
//
//    @Override
//    public void bindContentView() {
//        RedPacketAttachment attachment = (RedPacketAttachment) message.getAttachment();
//
//        if (!isReceivedMessage()) {// 消息方向，自己发送的
//            sendView.setVisibility(View.VISIBLE);
//            revView.setVisibility(View.GONE);
//            sendContentText.setText(attachment.getRpContent());
//            sendTitleText.setText(attachment.getRpTitle());
//        } else {
//            sendView.setVisibility(View.GONE);
//            revView.setVisibility(View.VISIBLE);
//            revContentText.setText(attachment.getRpContent());
//            revTitleText.setText(attachment.getRpTitle());
//        }
//    }
//
//    @Override
//    protected int leftBackground() {
//        return R.color.transparent;
//    }
//
//    @Override
//    protected int rightBackground() {
//        return R.color.transparent;
//    }
//
//    @Override
//    public void onItemClick() {
//        // 拆红包
//        RedPacketAttachment attachment = (RedPacketAttachment) message.getAttachment();
//
//        BaseMultiItemFetchLoadAdapter adapter = getAdapter();
//        ModuleProxy proxy = null;
//        if (adapter instanceof MsgAdapter) {
//            proxy = ((MsgAdapter) adapter).getContainer().proxy;
//        } else if (adapter instanceof ChatRoomMsgAdapter) {
//            proxy = ((ChatRoomMsgAdapter) adapter).getContainer().proxy;
//        }
//        NIMOpenRpCallback cb = new NIMOpenRpCallback(message.getFromAccount(), message.getSessionId(), message.getSessionType(), proxy);
//        NIMRedPacketClient.startOpenRpDialog((Activity) context, message.getSessionType(), attachment.getRpId(), cb);
//    }
//}
